<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:sf="http://www.springframework.org/tags/faces"
				template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="content">

<h:form id="users">
	<div class="section">
		<h2>Users</h2>
		<ui:fragment id="searchResultsFragment">
			<div id="searchResults">
				<h:outputText id="noUsersText" value="No Users Found" rendered="#{users.rowCount == 0}"/>
				<h:dataTable id="users" styleClass="summary" value="#{users}" var="user" rendered="#{users.rowCount > 0}">
					<h:column>
						<f:facet name="header">
							<sf:commandLink id="sortByNameLink" ajaxEnabled="false" action="sort" value="Name">
								<f:param name="sortBy" value="fullName" />
							</sf:commandLink>
						</f:facet>
						#{user.fullName}
					</h:column>
					<h:column>
						<f:facet name="header">Action</f:facet>
						<sf:commandLink id="viewUserLink" value="View User" action="select"/>
					</h:column>
				</h:dataTable>
				<div class="buttonGroup">
					<sf:commandLink id="previousPageLink" value="Previous results" action="previous" rendered="#{searchCriteria.page > 0}"/>
					<sf:commandLink id="nextPageLink" value="More Results" action="next" rendered="#{not empty hotels and hotels.rowCount == searchCriteria.pageSize}"/>
				</div>
			</div>
		</ui:fragment>
	</div>
</h:form>
</ui:define>
</ui:composition>